<!--
	作者：956911785@qq.com
	时间：2019年10月11日16:40:29
	描述：书籍信息统计
-->
<template>
    <div style="width:100%;"> 
		<Fytable ref="tdtable" height="550" :columns="columns9" type="post" :paramiters="searchparams" :serverUrl="serverUrl" @changeSort='changeSort'></Fytable>
		<readstatic ref="readstatic" :bss="bss"></readstatic>
		<noreadstatic ref="noreadstatic" :bss="bss"></noreadstatic>
	</div> 
</template>
<script>
	import readstatic from "./readstatic/manage";
	import noreadstatic from "./noreadstatic/manage";
    export default {
    	name: "bookstaticss",
    	props: {
    		tj:{
    			type: Object
    		},	
    	},
        data () {
            return {
				bss:{
					bid:'',
					jd:'',
				},
				searchparams:{
					pid:'',//上级分类
					classid:'',//书籍分类
					bookname:'',//书籍名称
					author:'',//作者
					nj:'',//推荐年级
					bj:'',//推荐班级
					order:'ALLNUM desc',//排序情况
				},
            	serverUrl:"/host/readbook/staticlog/bookplan_static.html",
                columns9: [
					{
					    type: 'index',
					    width: 60,
					    title: '序号',
					    align: 'center'
					},{
					    title: '分类名称',
					    key: 'CLASSNAME',
					    align: 'center', 
					},{
					    title: '书名',
					    key: 'BOOKNAME',
					    align: 'center', 
					}, {
					    title: '作者',
					    key: 'AUTHOR',
					    align: 'center', 
					}, {
					    title: '总页数',
					    key: 'TOTALPAGE',
					    align: 'center', 
					},{
					    title: '最低读书量',
					    key: 'MINNUM',
					    align: 'center', 
						sortable: true,
					},{
					    title: '推荐年级',
					    key: 'NJ',
					    align: 'center', 
						sortable: true,
					}, {
					    title: '推荐班级',
					    key: 'BJ',
					    align: 'center', 
						sortable: true,
					}, {
					    title: '推荐人',
					    key: 'RECOMMENDOR',
					    align: 'center', 
					}, {
					    title: '计划阅读人数',
					    key: 'ALLNUM',
					    align: 'center', 
						sortable: true,
						render: (h, params) => {
							return h("a", { 
						    	on: { 
						    		click: () => {
										this.bss={
											bid:params.row.BID,
											jd:'',
										};
						    			this.$refs.readstatic.modal0=true;
						    		}	
						    	} 
							},params.row.ALLNUM)
						},
					}, {
					    title: '已完成阅读人数',
					    key: 'YWC',
					    align: 'center', 
						sortable: true,
						render: (h, params) => {
							return h("a", { 
						    	on: { 
						    		click: () => {
						    			this.bss={
						    				bid:params.row.BID,
						    				jd:'100',
						    			};
						    			this.$refs.readstatic.modal0=true;
						    		}
						    	} 
							},params.row.YWC)
						}
					}, {
					    title: '未完成阅读人数',
					    key: 'WWC',
					    align: 'center', 
						sortable: true,
						render: (h, params) => {
							return h("a", { 
						    	on: { 
						    		click: () => {
						    			this.bss={
						    				bid:params.row.BID,
						    				jd:'0',
						    			};
						    			this.$refs.readstatic.modal0=true;
						    		}
						    	} 
							},params.row.WWC)
						}
					}, {
					    title: '未计划阅读人数',
					    key: 'WJH',
					    align: 'center', 
						sortable: true,
						render: (h, params) => {
							return h("a", { 
						    	on: { 
						    		click: () => {
						    			this.bss={
						    				bid:params.row.BID,
						    			};
						    			this.$refs.noreadstatic.modal0=true;
						    		}
						    	} 
							},params.row.WJH)
						}
					}
                ],
				
            }
        },
        computed: {
		},
		methods: {
			load(){
				this.$refs.tdtable.load();
			},
			
			changeSort(column){
				this.searchparams.order=column.key+" "+column.order;
			}

	    },
		mounted() {
			this.$refs.tdtable.load();
		},
		watch:{
			tj: {
				deep: true,
				handler: function() {
					this.searchparams={
						pid:this.tj.pid,//上级分类
						classid:this.tj.classid,//书籍分类
						bookname:this.tj.bookname,//书籍名称
						author:this.tj.author,//作者
						nj:this.tj.nj,//推荐年级
						bj:this.tj.bj,//推荐班级
						order:'ALLNUM desc',//排序情况
					}
				},	
			}
			
		},
		components: {
			readstatic,
			noreadstatic
		}
    }
</script>


<style scoped="scoped">
	
	.ivu-table-wrapper {
		border:none;
	}
	
	.toolstipdiv{
		width: '100%';
		overflow: 'hidden';
		textOverflow: 'ellipsis';
		whiteSpace: 'normal';
		wordBreak: 'break-all';
		color:'#fff';
		text-align: center;
	}
	.toolstipdiv:hover{
		background:rgb(63, 193, 201);
	}
	
	.ivu-tooltip-rel label:hover{
		color:#0023FB;
	}
	
	.tablediv{
		height: '40px';
		overflow:'hidden';
		line-height: '40px';
	}
</style>



